# 方法1
hs = input("请输入一个数，我将判断其是否为回文数：")
lists = []
for h in hs:
    lists.append(int(h))
b = int(len(lists)/2)
c = int((len(lists) - 1) / 2)
d = int(len(lists))
if len(lists) % 2 == 0 and sum(lists[0: b]) == sum(lists[b: int(len(lists))]):
    print("该数是回文数")
else:
    if len(lists) % 2 == 1 and sum(lists[0: c]) == sum(lists[c+1: d]):
        print("该数是回文数")
    else:
        print("该数不是回文数")

# 方法2
a = input("请输入一个数字：")
b = str(a)
if b == b[::-1]:
    print('a是回文数。')
else:
    print('a不是回文数')